<form action="index.php?app=content&ctl=admin_active_detail&act=save" method="post" name="aEditor" id="aEditor">
<input type="hidden" name="active_id" value="<{$active.active_id}>" id="aEditor-Gactiveid-input"/>

  <div id="aEditor-Body">
     <{include file="admin/active/detail/page.html"}>
  </div>
</form>

<script>
var activesEditFrame = (function(){

	/*
	 *  sign:{
		   1:保存并关闭,
		   2:保存当前不关闭，
	 *    }
	 */
	var _form=$('aEditor'),_formActionURL=_form.get('action');
	subArticleForm = function (event,sign){
	   event=new Event(event);
	   var specOBJ='';
	   var target={extraData:$('finder-tag').toQueryString()+'&'+specOBJ,onComplete:function(){}};

	   switch (sign){
			case 1:
				$extend(target,{
					onComplete:function(){
						window.close();
            if(opener.finderGroup&&opener.finderGroup['<{$env.get.finder_id}>'])
            {
              window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
            }
					}}
				);
			break;
			case 2:
				$extend(target,{
					onRequest: function(){
						event.target.disabled = true;
					},
					onComplete:function(e){
            if(opener.finderGroup&&opener.finderGroup['<{$env.get.finder_id}>'])
            {
              window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
            }
						if(!JSON.decode(e).id){
							event.target.removeProperty('disabled');
							return;
						}
						var id = JSON.decode(e).id;
						if(id > 0){
							$('aEditor-Gactiveid-input').value = JSON.decode(e).id;
						}
						event.target.disabled = false;
					}}
				);
			break;
			default:
			return;
	   }

		_form.store('target',target);
		_form.set('action',_formActionURL+'&but='+sign).fireEvent('submit',new Event(event));
	};
});

activesEditFrame();
</script>